﻿using Orchard.ContentManagement.Drivers;
using Orchard.Environment.Extensions;
using OrchardHUN.QnA.Models;
using Orchard.ContentManagement;

namespace OrchardHUN.QnA.Drivers
{
    /// <summary>
    /// This empty driver is necessary only because otherwise QnADiscussionPart doesn't get properly registered!
    /// See: http://orchard.codeplex.com/discussions/280862
    /// </summary>
    [OrchardFeature("OrchardHUN.QnA")]
    public class QnADiscussionPartDriver : ContentPartDriver<QnADiscussionPart>
    {
        private readonly IContentManager _contentManager;

        public QnADiscussionPartDriver(IContentManager contentManager)
        {
            _contentManager = contentManager;
        }

        protected override DriverResult Display(QnADiscussionPart part, string displayType, dynamic shapeHelper)
        {
            return ContentShape("Parts_DiscussionAdministrationLink",
                () => shapeHelper.Parts_DiscussionAdministrationLink());
        }
    }
}